package com.yang.xiaohoshuauth.controller;


import com.yang.common.response.Response;
import com.yang.framework.biz.operationlog.aspect.ApiOperationLog;
import com.yang.xiaohoshuauth.domain.vo.UserLoginReqVO;
import com.yang.xiaohoshuauth.service.UserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 用户
 */
@RestController
@RequestMapping("/user")
@Slf4j
public class UserController {

    @Resource
    UserService userService;

    @PostMapping("/login")
    @ApiOperationLog(description = "用户登录/注册")
    public Response<String> login(@Validated @RequestBody UserLoginReqVO userLoginReqVO) {
        return userService.loginAndRegister(userLoginReqVO);
    }
}
